//
// CPSFloatCurveFunctor.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.IStream;

public class CPSFloatCurveFunctor {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CPSFloatCurveFunctor(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CPSFloatCurveFunctor obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CPSFloatCurveFunctor(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CPSFloatCurveFunctor() {
    this(nel3dJNI.new_CPSFloatCurveFunctor(), true);
  }

  public void addControlPoint(SWIGTYPE_p_NL3D__CPSFloatCurveFunctor__CCtrlPoint ctrlPoint) {
    nel3dJNI.CPSFloatCurveFunctor_addControlPoint(swigCPtr, this, SWIGTYPE_p_NL3D__CPSFloatCurveFunctor__CCtrlPoint.getCPtr(ctrlPoint));
  }

  public long getNumCtrlPoints() {
    return nel3dJNI.CPSFloatCurveFunctor_getNumCtrlPoints(swigCPtr, this);
  }

  public SWIGTYPE_p_NL3D__CPSFloatCurveFunctor__CCtrlPoint getControlPoint(long index) {
    return new SWIGTYPE_p_NL3D__CPSFloatCurveFunctor__CCtrlPoint(nel3dJNI.CPSFloatCurveFunctor_getControlPoint(swigCPtr, this, index), false);
  }

  public void setCtrlPoint(long index, SWIGTYPE_p_NL3D__CPSFloatCurveFunctor__CCtrlPoint ctrlPoint) {
    nel3dJNI.CPSFloatCurveFunctor_setCtrlPoint(swigCPtr, this, index, SWIGTYPE_p_NL3D__CPSFloatCurveFunctor__CCtrlPoint.getCPtr(ctrlPoint));
  }

  public void removeCtrlPoint(long index) {
    nel3dJNI.CPSFloatCurveFunctor_removeCtrlPoint(swigCPtr, this, index);
  }

  public void setNumSamples(long numSamples) {
    nel3dJNI.CPSFloatCurveFunctor_setNumSamples(swigCPtr, this, numSamples);
  }

  public long getNumSamples() {
    return nel3dJNI.CPSFloatCurveFunctor_getNumSamples(swigCPtr, this);
  }

  public void enableSmoothing(boolean enable) {
    nel3dJNI.CPSFloatCurveFunctor_enableSmoothing__SWIG_0(swigCPtr, this, enable);
  }

  public void enableSmoothing() {
    nel3dJNI.CPSFloatCurveFunctor_enableSmoothing__SWIG_1(swigCPtr, this);
  }

  public boolean hasSmoothing() {
    return nel3dJNI.CPSFloatCurveFunctor_hasSmoothing(swigCPtr, this);
  }

  public float access(float time) {
    return nel3dJNI.CPSFloatCurveFunctor_access(swigCPtr, this, time);
  }

  public float getValue(float date) {
    return nel3dJNI.CPSFloatCurveFunctor_getValue(swigCPtr, this, date);
  }

  public void serial(IStream f) {
    nel3dJNI.CPSFloatCurveFunctor_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public float getMinValue() {
    return nel3dJNI.CPSFloatCurveFunctor_getMinValue(swigCPtr, this);
  }

  public float getMaxValue() {
    return nel3dJNI.CPSFloatCurveFunctor_getMaxValue(swigCPtr, this);
  }

}
